import request from '@/utils/http';
import { IUserItem } from './type';

export const userList = (params: any): Promise<App.RequestTableResult<IUserItem>> => {
  return request.get(`/mock/user`, { params });
};

/** 添加子账号 */
export const addUser = (data: any): Promise<App.RequestTableResult<IUserItem>> => {
  return request.post(`registry`, data);
};
/** 获取子账号列表 */
export const getAgentsUserListApi = (params: any): Promise<App.RequestTableResult<IUserItem>> => {
  return request.get(`getAgentsUserList`, { params });
};

/** 删除子账号用户 */
export const deleteUserApi = (params: any): Promise<App.RequestTableResult<IUserItem>> => {
  return request.delete(`deleteAgentsUser`, { params });
};

/**编辑子账号 */
export const editAgentsUserInfoApi = (data: any): Promise<App.RequestTableResult<IUserItem>> => {
  return request.put(`editAgentsUserInfo`, data);
};
